//
//                 librtmeus.h: written by T.Yoshikai 2010/05/26
//
#ifndef LIBRTMEUS_H_
#define LIBRTMEUS_H_

#include <coil/stringutil.h>
#include "rtmeus.h"

#define MAXRTMEUS 256

extern "C" {
    int init_rtm(char* host, int port, int man_no);
    void exit_rtm(void);
    int load_module(int rtmno, char* sopath, char* initfuncname);
    int create_component(int rtmno, char* classname, char* instancename, double exec_rate, char* exec_type, int stateflag);
    int resolve_component(int rtmno, char* searchpath, char* instancename, int stateflag);
    int find_component(int rtmno, char* searchpath, char* instancename);    
    const char* get_componentname(int rtmno, int component_no);
    int activate_component(int rtmno, int component_no);
    int deactivate_component(int rtmno, int component_no);
    int set_configuration(int rtmno, int component_no, char* configvar, char* config);
    int destroy(int rtmno, int component_no);
    int show_component_info(int rtmno, int component_no, int showlevel);
    int inputdata_to_component(int rtmno, int component_no, char* portname, char* datatype, char* data);
    const char* receivedata_from_component(int rtmno, int component_no, char* portname, char* datatype);
    const char* sendcommand_to_component(int rtmno, int component_no, char* command, char* argv);
    const char* getstates_from_component(int rtmno, int component_no, char* namelist);
    const char* setstates_to_component(int rtmno, int component_no, char* namelist, char* valuelist);
    void set_plugin_mode(int rtmno, int leader_component_no, int attatched_component_num, int* attatched_component_nos);
    void plugin_mode_allactivate(int rtmno, int leader_component_no, int attatched_component_num, int* attatched_component_nos, int interval);
    void plugin_mode_alldeactivate(int rtmno, int leader_component_no, int attatched_component_num, int* attatched_component_nos);
    int connect_components(int out_rtmno, int out_component_no, char* out_portname, int in_rtmno, int in_component_no, char* in_portname, int subscriptiontype);
    int disconnect_components(int out_rtmno, int out_component_no, char* out_portname, int in_rtmno, int in_component_no, char* in_portname);
}

#endif // LIBRTMEUS_H_
